<template>
  <div>
    <h1>选项式+组合式API写法</h1>
    <h1 v-text="num"></h1>
    <button @click="add">+1</button>
  </div>
</template>

<script>
import { ref } from "vue";
export default {
  setup() {
    const num = ref(1);
    return {
      num,
    };
  },
  methods: {
    add() {
      this.num++;
    },
  },
};
</script>

<style lang="scss" scoped>
</style>